﻿Imports System.Data.SqlClient
Public Class FormCustomer

    Private Sub frm_customer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


        Dim cn As New SqlConnection
        cn.ConnectionString = ("server=MYPC;UID=sa; PWD=123; database=HotelApp")
        cn.Open()
        ' MessageBox.Show("connect")

        Dim cmd As New SqlCommand
        cmd.Connection = cn
        cmd.CommandText = "SELECT * FROM TBL_Customer;"
        Dim dr As SqlDataReader = cmd.ExecuteReader()
        While dr.Read()
            DataGridView1.Rows.Add(dr.GetValue(0), dr.GetValue(1), dr.GetValue(3), dr.GetValue(4), dr.GetValue(5), dr.GetValue(6), dr.GetValue(7), dr.GetValue(8), dr.GetValue(9), dr.GetValue(10), dr.GetValue(11))

        End While
        dr.Close()

    End Sub

    Private Sub btn_CustAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_CustAdd.Click
        showForm(FormCustomerEdit)
    End Sub
    Private Sub showForm(ByVal form As Form)

        form.Show()
    End Sub

    Private Sub btncheckin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncheckin.Click
        frmcheck_in.Show()




    End Sub
End Class